package com.sakiko.audiobook.album.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sakiko.audiobook.model.album.TrackInfo;
import com.sakiko.audiobook.query.album.TrackInfoQuery;
import com.sakiko.audiobook.vo.album.AlbumTrackListVo;
import com.sakiko.audiobook.vo.album.TrackInfoVo;
import com.sakiko.audiobook.vo.album.TrackListVo;
import com.sakiko.audiobook.vo.album.TrackStatMqVo;

import java.util.List;
import java.util.Map;

public interface TrackInfoService extends IService<TrackInfo> {

    /**
     * 保存声音
     *
     * @param trackInfoVo
     * @param userId
     */
    void saveTrackInfo(TrackInfoVo trackInfoVo, Long userId);

    /**
     * 分页查询用户声音列表
     *
     * @param trackListVoPage
     * @param trackInfoQuery
     * @return
     */
    IPage<TrackListVo> findUserTrackPage(Page<TrackListVo> trackListVoPage, TrackInfoQuery trackInfoQuery);

    /**
     * 根据声音 Id删除声音对象
     *
     * @param trackId
     */
    void removeTrackInfo(Long trackId);

    /**
     * 根据声音 id获取声音对象
     *
     * @param trackId
     * @return
     */
    TrackInfo getTrackInfo(long trackId);

    /**
     * 修改声音
     *
     * @param trackId
     * @param trackInfoVo
     */
    void updateTrackInfo(Long trackId, TrackInfoVo trackInfoVo);

    /**
     * 分页查询专辑声音列表
     *
     * @param trackListVoPage
     * @param albumId
     * @param userId
     * @return
     */
    IPage<AlbumTrackListVo> findAlbumTrackPage(Page<AlbumTrackListVo> trackListVoPage, Long albumId, Long userId);

    /**
     * 修改声音播放次数
     *
     * @param trackStatMqVo
     */
    void trackStatUpdate(TrackStatMqVo trackStatMqVo);

    /**
     * 查询用户分集购买列表
     *
     * @param trackId
     * @return
     */
    List<Map<String, Object>> findUserTrackPaidList(Long trackId);

    /**
     * 下单付费声音列表
     * @param trackId
     * @param trackCount
     * @return
     */
    List<TrackInfo> findPaidTrackInfoList(Long trackId, Integer trackCount);
}
